package com.neusiri.route;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * RouteCustomer
 *
 * @author 丛有志
 * @date 2020/11/10 10:53
 * <p>
 * 版本        修改时间        作者        修改内容
 * V1.0        2020/11/10     丛有志        初始版本
 */
@Component
public class RouteCustomer {

    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(value = "directs", type = "direct"),
                    key = {"info", "error", "warn"}
            )
    })
    public void receivel1(String message) {
        System.out.println("message1=" + message);
    }

    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(value = "directs", type = "direct"),
                    key = {"error"}
            )
    })
    public void receivel2(String message) {
        System.out.println("message2=" + message);
    }
}
